﻿using QRCoder;
using System;
using System.Drawing;
using System.Windows.Forms;

namespace auto_win
{
    public partial class QRForm : Form
    {
        private string url;
        public QRForm(string url)
        {
            this.url = url;
            InitializeComponent();
        }

        private void GenerateQRCode()
        {
            QRCodeGenerator qrGenerator = new QRCodeGenerator();
            QRCodeData qrCodeData = qrGenerator.CreateQrCode(this.url, QRCodeGenerator.ECCLevel.Q);
            QRCode qrCode = new QRCode(qrCodeData);
            Bitmap qrCodeImage = qrCode.GetGraphic(7);
            pictureBox1.SizeMode = PictureBoxSizeMode.CenterImage; // 自动调整大小以适应图片
            pictureBox1.Image = qrCodeImage;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
